Remove GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 22 Feb 2020 14:54:48 +0000 (14:54 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Sat, 22 Feb 2020 15:22:06 +0000 (15:22 +0000)
We don't need a whole separate action, now that the file chooser widget
can create folders; we can create use SELECT_FOLDER and create one.

gtk/gtkfilechooser.h
gtk/gtkfilechooserbutton.c
gtk/gtkfilechooserdialog.c
gtk/gtkfilechooserentry.c
gtk/gtkfilechoosernativequartz.c
gtk/gtkfilechoosernativewin32.c
gtk/gtkfilechooserwidget.c
tests/testfilechooser.c
tests/testgtk.c
testsuite/gtk/object.c

index c641cba86c5ceb246cf683b3f6a87a996cfe0c99..dccef32ca09886dc3eac63ecf42dfbe1bb5519a1 100644 (file)
@@ -44,9 +44,6 @@ typedef struct _GtkFileChooser      GtkFileChooser;
  * @GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER: Indicates an Open mode for
  *  selecting folders.  The file chooser will let the user pick an
  *  existing folder.
- * @GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER: Indicates a mode for creating a
- *  new folder.  The file chooser will let the user name an existing or
- *  new folder.
  *
  * Describes whether a #GtkFileChooser is being used to open existing files
  * or to save to a possibly new file.
@@ -55,8 +52,7 @@ typedef enum
 {
   GTK_FILE_CHOOSER_ACTION_OPEN,
   GTK_FILE_CHOOSER_ACTION_SAVE,
-  GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
-  GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
+  GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
 } GtkFileChooserAction;
 
 GDK_AVAILABLE_IN_ALL
index 1a1ad540894a01aa9eee4f37a36886558c72f45d..1260128e4a9145859960e9f2766dc0bdb57c1662 100644 (file)
@@ -874,7 +874,6 @@ gtk_file_chooser_button_set_property (GObject      *object,
     case GTK_FILE_CHOOSER_PROP_ACTION:
       switch (g_value_get_enum (value))
        {
-       case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
        case GTK_FILE_CHOOSER_ACTION_SAVE:
          {
            GEnumClass *eclass;
@@ -1267,7 +1266,6 @@ gtk_file_chooser_button_mnemonic_activate (GtkWidget *widget,
       return gtk_widget_mnemonic_activate (priv->combo_box, group_cycling);
       break;
     case GTK_FILE_CHOOSER_ACTION_SAVE:
-    case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
     default:
       g_assert_not_reached ();
       break;
index 3cee2746287bea7e3e5a31824ede8c8e6b6cdb47..36e3e3e7420df7c0ff282c3ac467599f38073acd 100644 (file)
@@ -486,8 +486,7 @@ setup_save_entry (GtkFileChooserDialog *dialog)
 
   header = gtk_dialog_get_header_bar (GTK_DIALOG (dialog));
 
-  need_entry = action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-               action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER;
+  need_entry = action == GTK_FILE_CHOOSER_ACTION_SAVE;
 
   if (need_entry && !priv->has_entry)
     {
index 09146f49632225d74e87fcf6e200be7d6be17f8b..633ccbb4b218fd04e10e410f30d25c9c578c4933 100644 (file)
@@ -573,7 +573,6 @@ update_inline_completion (GtkFileChooserEntry *chooser_entry)
       gtk_entry_completion_set_inline_completion (completion, TRUE);
       break;
     case GTK_FILE_CHOOSER_ACTION_SAVE:
-    case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
     default:
       gtk_entry_completion_set_inline_completion (completion, FALSE);
       break;
@@ -985,7 +984,6 @@ _gtk_file_chooser_entry_set_action (GtkFileChooserEntry *chooser_entry,
          gtk_entry_completion_set_popup_single_match (comp, FALSE);
          break;
        case GTK_FILE_CHOOSER_ACTION_SAVE:
-       case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
          gtk_entry_completion_set_popup_single_match (comp, TRUE);
          break;
        }
index 168943f5c75a3b740389de53c84c3c640bd96d7f..900f2ab5fcea228ab1502cb08e3b21fd93578c1d 100644 (file)
@@ -487,12 +487,10 @@ gtk_file_chooser_native_quartz_show (GtkFileChooserNative *self)
 
   action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (self->dialog));
 
-  if (action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-      action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
     data->save = TRUE;
 
-  if (action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
-      action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     data->folder = TRUE;
 
   if ((action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
@@ -522,8 +520,7 @@ gtk_file_chooser_native_quartz_show (GtkFileChooserNative *self)
       if (self->current_folder)
         data->current_folder = g_object_ref (self->current_folder);
 
-      if (action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-          action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+      if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
         data->current_name = g_strdup (self->current_name);
     }
 
index 5044ca498e9c5ba36664954d95a41c059f1897ca..feec909d4640d6d0b0549e88ed91ba89509273ac 100644 (file)
@@ -906,12 +906,10 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self)
   data->cancel_label = translate_mnemonics (self->cancel_label);
 
   action = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (self->dialog));
-  if (action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-      action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
     data->save = TRUE;
 
-  if (action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
-      action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     data->folder = TRUE;
 
   if ((action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
@@ -939,8 +937,7 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self)
       if (self->current_folder)
         data->current_folder = g_object_ref (self->current_folder);
 
-      if (action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-          action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+      if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
         data->current_name = g_strdup (self->current_name);
     }
 
index 4ace72d9c54213c9b285205eb76137191b2682c0..17d0a7ab54da3fe4d8c640dd3518fd530cef378b 100644 (file)
@@ -809,21 +809,6 @@ error_creating_folder_dialog (GtkFileChooserWidget *impl,
                 error);
 }
 
-/* Shows an error about not being able to create a folder because a file with
- * the same name is already there.
- */
-static void
-error_creating_folder_over_existing_file_dialog (GtkFileChooserWidget *impl,
-                                                 GFile                 *file,
-                                                 GError                *error)
-{
-  error_dialog (impl,
-                _("The folder could not be created, as a file with the same "
-                  "name already exists.  Try using a different name for the "
-                  "folder, or rename the file first."),
-                error);
-}
-
 static void
 error_with_file_under_nonfolder (GtkFileChooserWidget *impl,
                                  GFile *parent_file)
@@ -1244,9 +1229,7 @@ places_sidebar_open_location_cb (GtkPlacesSidebar     *sidebar,
   /* In the Save modes, we want to preserve what the user typed in the filename
    * entry, so that he may choose another folder without erasing his typed name.
    */
-  if (priv->location_entry
-      && !(priv->action == GTK_FILE_CHOOSER_ACTION_SAVE
-           || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
+  if (priv->location_entry && priv->action != GTK_FILE_CHOOSER_ACTION_SAVE)
     clear_entry = TRUE;
   else
     clear_entry = FALSE;
@@ -1330,14 +1313,13 @@ treeview_key_press_cb (GtkEventControllerKey *controller,
       return GDK_EVENT_STOP;
     }
 
-  if ((keyval == GDK_KEY_Return
-       || keyval == GDK_KEY_ISO_Enter
-       || keyval == GDK_KEY_KP_Enter
-       || keyval == GDK_KEY_space
-       || keyval == GDK_KEY_KP_Space)
-      && !(state & gtk_accelerator_get_default_mod_mask ())
-      && !(priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
-           priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
+  if ((keyval == GDK_KEY_Return ||
+       keyval == GDK_KEY_ISO_Enter ||
+       keyval == GDK_KEY_KP_Enter ||
+       keyval == GDK_KEY_space ||
+       keyval == GDK_KEY_KP_Space) &&
+      !(state & gtk_accelerator_get_default_mod_mask ()) &&
+      priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     {
       gtk_widget_activate_default (GTK_WIDGET (impl));
       return GDK_EVENT_STOP;
@@ -2740,8 +2722,7 @@ location_toggle_popup_handler (GtkFileChooserWidget *impl)
    * If it is visible, turn it off only if it is focused.
    * Otherwise, switch to the entry.
    */
-  if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-      priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
     {
       gtk_widget_grab_focus (priv->location_entry);
     }
@@ -3108,8 +3089,7 @@ update_appearance (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
 
-  if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-      priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
     {
       save_widgets_create (impl);
       gtk_places_sidebar_set_show_recent (GTK_PLACES_SIDEBAR (priv->places_sidebar), FALSE);
@@ -3243,13 +3223,13 @@ gtk_file_chooser_widget_set_property (GObject      *object,
           {
             gtk_file_chooser_widget_unselect_all (GTK_FILE_CHOOSER (impl));
 
-            if ((action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-                 action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
-                && priv->select_multiple)
+            if (action == GTK_FILE_CHOOSER_ACTION_SAVE &&
+                priv->select_multiple)
               {
-                g_warning ("Tried to change the file chooser action to SAVE or CREATE_FOLDER, but "
-                           "this is not allowed in multiple selection mode.  Resetting the file chooser "
-                           "to single selection mode.");
+                g_warning ("Tried to change the file chooser action to SAVE, "
+                           "but this is not allowed in multiple selection "
+                           "mode. Resetting the file chooser to single "
+                           "selection mode.");
                 set_select_multiple (impl, FALSE);
               }
             priv->action = action;
@@ -3281,13 +3261,13 @@ gtk_file_chooser_widget_set_property (GObject      *object,
     case GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLE:
       {
         gboolean select_multiple = g_value_get_boolean (value);
-        if ((priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-             priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
-            && select_multiple)
+        if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE &&
+            select_multiple)
           {
-            g_warning ("Tried to set the file chooser to multiple selection mode, but this is "
-                       "not allowed in SAVE or CREATE_FOLDER modes.  Ignoring the change and "
-                       "leaving the file chooser in single selection mode.");
+            g_warning ("Tried to set the file chooser to multiple selection "
+                       "mode, but this is not allowed in SAVE mode.  Ignoring "
+                       "the change and leaving the file chooser in single "
+                       "selection mode.");
             return;
           }
 
@@ -4796,8 +4776,7 @@ file_system_model_set (GtkFileSystemModel *model,
         {
           gboolean sensitive = TRUE;
 
-          if (!(priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
-                || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER))
+          if (priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
             {
               sensitive = TRUE; /* for file modes... */
             }
@@ -5079,7 +5058,6 @@ update_chooser_entry (GtkFileChooserWidget *impl)
     return;
 
   if (!(priv->action == GTK_FILE_CHOOSER_ACTION_SAVE
-        || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
         || ((priv->action == GTK_FILE_CHOOSER_ACTION_OPEN
              || priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
             && priv->location_mode == LOCATION_MODE_FILENAME_ENTRY)))
@@ -5118,8 +5096,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
             g_strdup (g_file_info_get_display_name (info));
 
           if (priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
-              priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-              priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+              priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
             {
               /* Don't change the name when clicking on a folder... */
               change_entry = !_gtk_file_info_consider_as_directory (info);
@@ -5156,8 +5133,7 @@ update_chooser_entry (GtkFileChooserWidget *impl)
     }
   else
     {
-      g_assert (!(priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-                  priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER));
+      g_assert (priv->action != GTK_FILE_CHOOSER_ACTION_SAVE);
 
       /* Multiple selection, so just clear the entry. */
       g_free (priv->browse_files_last_selected_name);
@@ -5485,8 +5461,7 @@ gtk_file_chooser_widget_set_current_name (GtkFileChooser *chooser,
   GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser);
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
 
-  g_return_if_fail (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-                    priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
+  g_return_if_fail (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE);
 
   pending_select_files_free (impl);
   gtk_editable_set_text (GTK_EDITABLE (priv->location_entry), name);
@@ -5498,9 +5473,7 @@ gtk_file_chooser_widget_get_current_name (GtkFileChooser *chooser)
   GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (chooser);
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
 
-  g_return_val_if_fail (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-                        priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
-                        NULL);
+  g_return_val_if_fail (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE, NULL);
 
   return g_strdup (gtk_editable_get_text (GTK_EDITABLE (priv->location_entry)));
 }
@@ -5676,7 +5649,6 @@ check_save_entry (GtkFileChooserWidget  *impl,
   GError *error;
 
   g_assert (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-            priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ||
             ((priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
               priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) &&
              priv->location_mode == LOCATION_MODE_FILENAME_ENTRY));
@@ -5851,8 +5823,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
   else
     {
       /* The focus is on a dialog's action area button or something else */
-      if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-          priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+      if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
         goto file_entry;
       else
         goto file_list;
@@ -6303,8 +6274,7 @@ name_entry_get_parent_info_cb (GCancellable *cancellable,
           else
             request_response_and_add_to_recent_list (impl);
         }
-      else if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
-               || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+      else if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
         {
           GError *mkdir_error = NULL;
 
@@ -6400,21 +6370,6 @@ file_exists_get_info_cb (GCancellable *cancellable,
             needs_parent_check = TRUE; /* file doesn't exist; see if its parent exists */
         }
     }
-  else if (priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
-    {
-      if (file_exists && !is_folder)
-        {
-          /* Oops, the user typed the name of an existing path which is not
-           * a folder
-           */
-          error_creating_folder_over_existing_file_dialog (impl, data->file,
-                                                           g_error_copy (error));
-        }
-      else
-        {
-          needs_parent_check = TRUE;
-        }
-    }
   else if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     {
       if (!file_exists)
@@ -6572,12 +6527,11 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
         SAVE_ENTRY,             /* Go to the code for handling the save entry */
         NOT_REACHED             /* Sanity check */
       } ActionToTake;
-      static const ActionToTake what_to_do[4][3] = {
+      static const ActionToTake what_to_do[3][3] = {
         /*                           0 selected  1 selected         many selected */
         /* ACTION_OPEN */          { NOOP,       RESPOND_OR_SWITCH, ALL_FILES   },
         /* ACTION_SAVE */          { SAVE_ENTRY, RESPOND_OR_SWITCH, NOT_REACHED },
         /* ACTION_SELECT_FOLDER */ { RESPOND,    ALL_FOLDERS,       ALL_FOLDERS },
-        /* ACTION_CREATE_FOLDER */ { SAVE_ENTRY, ALL_FOLDERS,       NOT_REACHED }
       };
 
       int num_selected;
@@ -6587,7 +6541,7 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
 
     file_list:
 
-      g_assert (priv->action >= GTK_FILE_CHOOSER_ACTION_OPEN && priv->action <= GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER);
+      g_assert (priv->action >= GTK_FILE_CHOOSER_ACTION_OPEN && priv->action < GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
 
       if (priv->operation_mode == OPERATION_MODE_RECENT)
         {
@@ -6665,7 +6619,6 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
     save_entry:
 
       g_assert (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-                priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER ||
                 ((priv->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
                   priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) &&
                  priv->location_mode == LOCATION_MODE_FILENAME_ENTRY));
@@ -6696,8 +6649,7 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
 
       if (is_empty)
         {
-          if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-              priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+          if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
             {
               /* FIXME: ERROR_NO_FILENAME */
               gtk_widget_grab_focus (priv->location_entry);
@@ -6716,8 +6668,7 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
             {
               change_folder_and_display_error (impl, file, TRUE);
             }
-          else if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
-                   priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+          else if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
             {
               /* The folder already exists, so we do not need to create it.
                * Just respond to terminate the dialog.
@@ -6779,8 +6730,7 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
     }
   else
     /* The focus is on a dialog's action area button or something else */
-    if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-        priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+    if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
       goto save_entry;
     else
       goto file_list;
@@ -6810,8 +6760,7 @@ gtk_file_chooser_widget_initial_focus (GtkFileChooserEmbed *chooser_embed)
       else
         widget = priv->location_entry;
     }
-  else if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-           priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  else if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
     widget = priv->location_entry;
   else
     {
@@ -7445,8 +7394,7 @@ list_select_func (GtkTreeSelection *selection,
   GtkFileChooserWidget *impl = data;
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
 
-  if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
-      priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     {
       GtkTreeIter iter;
       gboolean is_sensitive;
@@ -7655,8 +7603,7 @@ location_popup_handler (GtkFileChooserWidget *impl,
       location_mode_set (impl, LOCATION_MODE_FILENAME_ENTRY);
       location_set_user_text (impl, path);
     }
-  else if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-           priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  else if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
     {
       gtk_widget_grab_focus (priv->location_entry);
       if (path != NULL)
@@ -8314,8 +8261,7 @@ gtk_file_chooser_widget_set_save_entry (GtkFileChooserWidget *impl,
 
   priv->external_entry = entry;
 
-  if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
-      priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (priv->action == GTK_FILE_CHOOSER_ACTION_SAVE)
     {
       save_widgets_destroy (impl);
       save_widgets_create (impl);
index 8a3aca95d3be100eca03a721bcffc60a59b63312..e96058aa4cbbeba6e4f723fe0c625ffa150f89fc 100644 (file)
@@ -547,11 +547,9 @@ main (int argc, char **argv)
        action = GTK_FILE_CHOOSER_ACTION_SAVE;
       else if (! strcmp ("select_folder", action_arg))
        action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
-      else if (! strcmp ("create_folder", action_arg))
-       action = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER;
       else
        {
-         g_print ("--action must be one of \"open\", \"save\", \"select_folder\", \"create_folder\"\n");
+         g_print ("--action must be one of \"open\", \"save\", \"select_folder\"\n");
          return 1;
        }
 
@@ -574,7 +572,6 @@ main (int argc, char **argv)
                              NULL);
       break;
     case GTK_FILE_CHOOSER_ACTION_SAVE:
-    case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
       gtk_window_set_title (GTK_WINDOW (dialog), "Save a file");
       gtk_dialog_add_buttons (GTK_DIALOG (dialog),
                              _("_Cancel"), GTK_RESPONSE_CANCEL,
index 5e355f2b7bc9f311bcfd3726b8c15a0fd6c25342..3c06592a6a0f61ae4828070e68b64bab92916244 100644 (file)
@@ -5852,8 +5852,7 @@ native_action_changed (GtkWidget *combo,
                                (GtkFileChooserAction) i);
 
 
-  if (i == GTK_FILE_CHOOSER_ACTION_SAVE ||
-      i == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+  if (i == GTK_FILE_CHOOSER_ACTION_SAVE)
     {
       if (save_as)
         {
index 2acfce4633a2d9a368e52b7092a6b7e6e3c6ae7f..3ed33ca93f41e444911dcf1f5b2a65eee4403f0c 100644 (file)
@@ -69,7 +69,6 @@ list_ignore_properties (gboolean buglist)
     { "GtkColorSelection",      "current-color",        (void*) NULL, },                /* not a valid boxed color */
     { "GtkFileChooserButton",   "select-multiple",      (void*) MATCH_ANY_VALUE },      /* property disabled */
     { "GtkFileChooserButton",   "action",               (void*) GTK_FILE_CHOOSER_ACTION_SAVE },
-    { "GtkFileChooserButton",   "action",               (void*) GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER },
     { "GtkFileChooserWidget",   "select-multiple",      (void*) 0x1 },                  /* property conflicts */
     { "GtkFileChooserDialog",   "select-multiple",      (void*) MATCH_ANY_VALUE },      /* property disabled */
     { "GtkTextView",            "overwrite",            (void*) MATCH_ANY_VALUE },      /* needs text buffer */